package com.ysg.sportsportlsit.service.impl;

import com.ysg.common.utils.DateUtils;
import com.ysg.sportsportlsit.domain.SportNotice;
import com.ysg.sportsportlsit.mapper.SportNoticeMapper;
import com.ysg.sportsportlsit.service.ISportNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 通知公告Service业务层处理
 * 
 * @author 叶双贵
 * @date 2022-04-03
 */
@Service
public class SportNoticeServiceImpl implements ISportNoticeService
{
    @Autowired
    private SportNoticeMapper sportNoticeMapper;

    /**
     * 查询弹窗通知公告
     * @return 通知公告
     */
    @Override
    public int querybouncedzt() {
        return sportNoticeMapper.querybouncedzt();
    }

    /**
     * 查询通知公告
     * 
     * @param noticeUuid 通知公告主键
     * @return 通知公告
     */
    @Override
    public SportNotice selectSportNoticeByNoticeUuid(String noticeUuid)
    {
        return sportNoticeMapper.selectSportNoticeByNoticeUuid(noticeUuid);
    }

    /**
     * 查询通知公告列表
     * 
     * @param sportNotice 通知公告
     * @return 通知公告
     */
    @Override
    public List<SportNotice> selectSportNoticeList(SportNotice sportNotice)
    {
        return sportNoticeMapper.selectSportNoticeList(sportNotice);
    }

    /**
     * 新增通知公告
     * 
     * @param sportNotice 通知公告
     * @return 结果
     */
    @Override
    public int insertSportNotice(SportNotice sportNotice)
    {
        sportNotice.setCreateTime(DateUtils.getNowDate());
        return sportNoticeMapper.insertSportNotice(sportNotice);
    }

    /**
     * 修改通知公告
     * 
     * @param sportNotice 通知公告
     * @return 结果
     */
    @Override
    public int updateSportNotice(SportNotice sportNotice)
    {
        sportNotice.setUpdateTime(DateUtils.getNowDate());
        return sportNoticeMapper.updateSportNotice(sportNotice);
    }

    /**
     * 批量删除通知公告
     * 
     * @param noticeUuids 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deleteSportNoticeByNoticeUuids(String[] noticeUuids)
    {
        return sportNoticeMapper.deleteSportNoticeByNoticeUuids(noticeUuids);
    }

    /**
     * 删除通知公告信息
     * 
     * @param noticeUuid 通知公告主键
     * @return 结果
     */
    @Override
    public int deleteSportNoticeByNoticeUuid(String noticeUuid)
    {
        return sportNoticeMapper.deleteSportNoticeByNoticeUuid(noticeUuid);
    }
}
